import { defineStore } from "pinia";

export const useRightMeshEditStore = defineStore("rightMeshEditStore", {
  state: () => ({
    mediumMeshThickness: false, //中面网格厚度
    formValue: "{}", //中面网格厚度
    stretching3D: false, //拉伸 三维
    formModelValue: "{}", //拉伸 三维
    scanning3D: false, //扫掠 三维
    formScanningModelValue: "{}", //扫掠 三维

    rodUnitCreationModel: false, //杆单元创建
    rodUnitCreationModelValue: "{}", //杆单元创建

    beamModel: false, //梁单元创建
    beamModelValue: "{}", //梁单元创建

    nodeStitchingModel: false, //节点缝合
    nodeStitchingValue: "{}", //节点缝合

    unitSeparation: false, // 单元分离
    unitSeparationValue: "{}", //节单元分离

    joinMesherOpen: false, // 网格编辑-合并
  }),
  actions: {
    setMediumMeshThickness(value: boolean) {
      this.mediumMeshThickness = value;
    },
    setFormValue(value: Record<string, any>) {
      this.formValue = JSON.stringify(value);
    },

    setStretching3D(value: boolean) {
      this.stretching3D = value;
    },
    setJoinMesher(value: boolean) {
      this.joinMesherOpen = value;
    },
    setformModelValue(value: Record<string, any>) {
      this.formModelValue = JSON.stringify(value);
    },

    setScanning3D(value: boolean) {
      this.scanning3D = value;
    },
    setFormScanningModelValue(value: Record<string, any>) {
      this.formScanningModelValue = JSON.stringify(value);
    },
    setRodUnitCreationModel(value: boolean) {
      this.rodUnitCreationModel = value;
    },
    setRodUnitCreationModelValue(value: Record<string, any>) {
      this.rodUnitCreationModelValue = JSON.stringify(value);
    },

    setBeamModel(value: boolean) {
      this.beamModel = value;
    },
    setSeamModelValue(value: Record<string, any>) {
      this.beamModelValue = JSON.stringify(value);
    },

    setNodeStitchingModel(value: boolean) {
      this.nodeStitchingModel = value;
    },
    setNodeStitchingValue(value: Record<string, any>) {
      this.nodeStitchingValue = JSON.stringify(value);
    },

    setUnitSeparation(value: boolean) {
      this.unitSeparation = value;
    },
    setUnitSeparationValue(value: Record<string, any>) {
      this.unitSeparationValue = JSON.stringify(value);
    },
  },
});
